

public class lx {

	
	
	public static int[] numArray= {5,3,11,34,6,13,7,22,17,8,2};
	public static int sum=0;
	public static void main(String[] argc){
		
		
	
		
		
		
	int len=numArray.length;
	quitSort(0, len-1);
	for(int i=0;i<len;i++) {
		
		echo(numArray[i]+" ");
	}

		
		
		
		
		echoln("over");
		
		
		
	
	}
	
	
	
	
	public static void quitSort(int low,int hight) {
		
		
			
			
			int i=low+1,j=hight;
			if(low > hight) {
				
				
				return ;
			}
			while(true) {
				while((numArray[i] <= numArray[low]) && i < hight) {
				i++;
				}
			
				while((numArray[j] >= numArray[low]) &&  j > low) {
					
					j--;
				}
				if( i<j) {
				
				
				int temp=numArray[i];
				numArray[i]=numArray[j];
				numArray[j]=temp;
				}else {
				
					break;
				}
			
			
			}
			int temp=numArray[low];
			numArray[low]=numArray[j];
			numArray[j]=temp;
			
			quitSort(low, j-1);
			quitSort(j+1, hight);
			
		
		
		
	}
	

	
	public static void echo(int  msg){
		
		
		System.out.print(msg);
	}
	public static void echo(String msg){
		
		
		System.out.print(msg);
	}
	public static void echoln(String msg) {
		
		
		echo(msg+"\n");
	}

	

}

